@import '../style/theme/color';
@import '../style/theme/variables';
@import '../style/mixins/index';
@import '../style/core/font';

:host {
  display: block;
}

.devui-nav-tabs,
.devui-nav-pills {
  font-size: $font-size-secondary-card-title;
  background: transparent;
  font-weight: bold;

  li {
    cursor: pointer;
    border: 2px solid transparent;

    & > a {
      cursor: pointer;
      border: none;
      line-height: 30px;
      background-color: transparent;
      padding: 0;
      color: $dark-1;
    }

    & > a:hover,
    & > a:focus,
    & > a:active {
      outline: none;
    }

    &.disabled {
      a {
        color: $disabled-content;
        cursor: not-allowed;
      }
    }

    &.active,
    &:hover:not(.disabled) {
      & > a {
        color: $brand-1;
      }
    }
  }

  li::after {
    content: '';
    display: block;
    margin: auto;
    height: 2px;
    width: 0;
    background: transparent;
    transition: width 0.3s ease-out, background-color 0.3s ease-out;
  }

  li.active::after {
    width: 100%;
    background: $brand-1;
  }
}

.devui-nav-options {
  font-size: $font-size-base;
  background: transparent;
  border: none;
  border-radius: 1px;

  > li {
    cursor: pointer;
    border: 1px solid $gray-1;
    border-left-width: 0;
    background-color: $bg-white;
    float: left;

    &:first-child {
      border-left-width: 1px;
      border-radius: 2px 0 0 2px;
    }

    &:last-child {
      border-radius: 0 2px 2px 0;
    }

    & > a {
      cursor: pointer;
      border: none;
      color: $dark-1;
      line-height: 26px;
      padding: 0 15px;

      &:hover,
      &:focus,
      &:active {
        outline: none;
      }
    }

    &.disabled {
      border-color: $disabled-border;

      a {
        color: $disabled-content;
        cursor: not-allowed;
      }
    }

    &.active,
    &:hover:not(.disabled) {
      & > a {
        color: $font-white;

        &:hover {
          color: $font-white;
          background: transparent;
        }
      }

      &:not(:first-child)::before {
        content: '';
        display: block;
        top: -1px;
        left: -1px;
        width: 1px;
        height: 'calc(100% + 2px)';
        position: absolute;
      }
    }

    &.active {
      background-color: $brand-1;
      border-color: $brand-1;

      &:not(:first-child)::before {
        background-color: $brand-1;
      }

      & + li::before {
        background-color: $brand-1;
      }
    }

    &:hover:not(.active):not(.disabled) {
      background-color: $hover-control;
      border-color: $hover-control;

      &:not(:first-child)::before {
        background-color: $hover-control;
      }
    }
  }
}

.devui-nav {
  li {
    > a.custom-width {
      display: inline-block;
      padding: 0;
      text-align: center;
    }
  }
}

.devui-nav-tabs:not(.devui-nav-stacked) {
  border-bottom: 1px $gray-1 solid;

  li {
    float: left;
    margin-left: 32px;
    margin-bottom: -3px;

    &:first-child {
      margin-left: 0;
    }
  }
}

.devui-nav-pills:not(.devui-nav-stacked) {
  > li {
    float: left;
    margin-left: 32px;

    &:first-child {
      margin-left: 0;
    }
  }
}

.devui-nav::before,
.devui-nav::after {
  content: ' ';
  display: table;
}

.devui-nav::after {
  clear: both;
}

.devui-tab-content {
  margin-top: 20px;
}
